/** 
  国际学术会议查询
*/
<template>
    <div>
        <div v-if="ifShowList === 1">
            <condition-card
                @reset="reset"
                @search="onSubmit"
                label-position="right"
                label-width="150px"
            >
                <el-row :gutter="24" style="height: 50px;">
                    <!-- 学院 -->
                    <el-col :span="8">
                        <el-form-item :label="$t('conOfIntAcaCon.faculty')">
                            <el-select
                                v-model.trim="queryForm.condition.faculty"
                                clearable
                                style="width: 100%"
                                filterable
                                @change="changeCollege"
                                placeholder=""
                            >
                                <el-option
                                    v-for="item in options.faculty"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value"
                                ></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <!-- 专业 -->
                    <el-col :span="8">
                        <el-form-item :label="$t('InterAcaConfer.profession')">
                            <el-select
                                v-model.trim="queryForm.condition.profession"
                                clearable
                                style="width: 100%"
                                placeholder=""
                            >
                                <el-option
                                    v-for="item in options.profession"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value"
                                ></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <!-- 学号 -->
                    <el-col :span="8">
                        <el-form-item :label="$t('InterAcaConfer.studentId')">
                            <el-input
                                v-model.trim="queryForm.condition.studentId"
                                maxlength="40"
                                class="topic-input-select"
                                placeholder=""
                            ></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>

                <el-row :gutter="24" style="height: 50px;">
                    <!-- 姓名 -->
                    <el-col :span="8">
                        <el-form-item :label="$t('InterAcaConfer.studentName')">
                            <el-input
                                v-model.trim="queryForm.condition.studentName"
                                maxlength="40"
                                class="topic-input-select"
                                placeholder=""
                            ></el-input>
                        </el-form-item>
                    </el-col>
                    <!-- 会议级别 -->
                    <el-col :span="8">
                        <el-form-item :label="$t('InterAcaConfer.conferenceLevel')">
                            <el-select
                                v-model.trim="queryForm.condition.conferenceLevel"
                                clearable
                                style="width: 100%"
                                placeholder=""
                            >
                                <el-option
                                    v-for="item in options.conferenceLevel"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value"
                                ></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <!-- 会议审核状态 -->
                    <el-col :span="8">
                        <el-form-item :label="$t('InterAcaConfer.approveStatus')">
                            <el-select
                                v-model.trim="queryForm.condition.approveStatus"
                                clearable
                                style="width: 100%"
                                placeholder=""
                            >
                                <el-option
                                    v-for="item in options.approveStatus"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value"
                                ></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row :gutter="24" style="height: 50px;">
                    <!-- 报销审核状态 -->
                    <el-col :span="8">
                        <el-form-item :label="$t('InterAcaConfer.reimbursementStatus')">
                            <el-select
                                v-model.trim="queryForm.condition.reimbursementStatus"
                                clearable
                                style="width: 100%"
                                placeholder=""
                            >
                                <el-option
                                    v-for="item in options.reimbursementStatus"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value"
                                ></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <!-- 会议开始时间 -->
                    <el-col :span="8">
                        <el-form-item :label="$t('InterAcaConfer.conferenceStartTime')">
                            <el-date-picker
                                v-model="queryForm.condition.conferenceStartTime"
                                type="date"
                                style="width:100%"
                                value-format="yyyy-MM-dd HH:mm:ss"
                                :picker-options="startDatePicker"
                            ></el-date-picker>
                        </el-form-item>
                    </el-col>
                    <!-- 会议结束时间 -->
                    <el-col :span="8">
                        <el-form-item :label="$t('InterAcaConfer.conferenceEndTime')">
                            <el-date-picker
                                v-model="queryForm.condition.conferenceEndTime"
                                type="date"
                                style="width:100%"
                                value-format="yyyy-MM-dd HH:mm:ss"
                                :picker-options="endDatePicker"
                            ></el-date-picker>
                        </el-form-item>
                    </el-col>
                </el-row>

                <el-row :gutter="24" style="height: 50px;">
                    <!-- 审核通过时间 -->
                    <el-col :span="8">
                        <el-form-item :label="$t('InterAcaConfer.auditTimeRange')">
                            <el-date-picker
                                v-model="auditTimeRange"
                                type="daterange"
                                style="width:100%"
                                :range-separator="$t('InterAcaConfer.to')"
                                :start-placeholder="$t('InterAcaConfer.startTime')"
                                :end-placeholder="$t('InterAcaConfer.endTime')"
                                value-format="yyyy-MM-dd HH:mm:ss"
                            ></el-date-picker>
                        </el-form-item>
                    </el-col>
                </el-row>
            </condition-card>
            <el-card shadow="never" v-loading="loading" body-style="padding: 24px;">
                <h1 class="condition-title">{{ $t('conOfIntAcaCon.ListOfInterAcaConfer') }}</h1>
                <div class="sub-title">
                    <div class="float-left">
                        <el-input
                            v-model.trim="queryForm.condition.conferenceCnOrEn"
                            :placeholder="$t('InterAcaConfer.conferenceCnOrEn')"
                            style="width:250px"
                            @keyup.enter.native="onSubmit"
                        >
                            <i
                                slot="suffix"
                                class="el-icon-search"
                                style="margin-top:10px;cursor:pointer"
                                @click="onSubmit"
                            ></i>
                        </el-input>
                    </div>
                    <div class="float-right" style="display: flex;">
                        <el-button type="primary" @click="exportConference('advance')">
                            {{ $t('InterAcaConfer.advanceExport') }}
                        </el-button>
                        <el-button type="primary" @click="exportConference('export')">
                            {{ $t('InterAcaConfer.exportFile') }}
                        </el-button>
                        <el-button type="primary" @click="exportConference('rev')">
                            {{ $t('InterAcaConfer.revExport') }}
                        </el-button>
                    </div>
                </div>
                <edu-table
                    :pagination="false"
                    :order="true"
                    :tooltipEffect="tooltipEffect"
                    stripe
                    :data="dataList"
                    size="small"
                    @selection-change="handleSelectionChange"
                >
                    <edu-table-column
                        :label="$t('InterAcaConfer.studentId')"
                        prop="studentId"
                        align="center"
                    ></edu-table-column>
                    <edu-table-column
                        :label="$t('InterAcaConfer.studentName')"
                        prop="studentName"
                        align="center"
                    ></edu-table-column>
                    <edu-table-column
                        :label="$t('conOfIntAcaCon.faculty')"
                        prop="facultyName"
                        align="center"
                    ></edu-table-column>
                    <edu-table-column
                        :label="$t('InterAcaConfer.profession')"
                        prop="professionName"
                        align="center"
                    ></edu-table-column>
                    <edu-table-column
                        :label="$t('InterAcaConfer.englishNameM')"
                        prop="englishName"
                        min-width="150"
                        align="center"
                    ></edu-table-column>
                    <edu-table-column
                        :label="$t('conOfIntAcaCon.englishNameAbbreviationM')"
                        prop="englishNameAbbreviation"
                        min-width="190"
                        align="center"
                    ></edu-table-column>
                    <edu-table-column
                        :label="$t('InterAcaConfer.nameM')"
                        prop="name"
                        min-width="150"
                        align="center"
                    ></edu-table-column>
                    <edu-table-column
                        :label="$t('InterAcaConfer.conferenceLevel')"
                        prop="conferenceLevel"
                        align="center"
                    >
                        <template slot-scope="scope">
                            {{ scope.row.conferenceLevel | meeting }}
                        </template>
                    </edu-table-column>
                    <edu-table-column
                        :label="$t('InterAcaConfer.conferenceStartTime')"
                        prop="conferenceStartTime"
                        min-width="120"
                        align="center"
                    ></edu-table-column>
                    <edu-table-column
                        :label="$t('InterAcaConfer.conferenceEndTime')"
                        prop="conferenceEndTime"
                        min-width="120"
                        align="center"
                    ></edu-table-column>
                    <edu-table-column
                        :label="$t('InterAcaConfer.realLeaveTime')"
                        prop="realLeaveTime"
                        min-width="120"
                        align="center"
                    ></edu-table-column>
                    <edu-table-column
                        :label="$t('InterAcaConfer.realBackTime')"
                        prop="realBackTime"
                        min-width="120"
                        align="center"
                    ></edu-table-column>
                    <edu-table-column
                        :label="$t('InterAcaConfer.approveStatus')"
                        prop="approveStatus"
                        min-width="120"
                        align="center"
                    >
                        <template slot-scope="scope">
                            <el-tag
                                v-if="scope.row.approveStatus !== null"
                                :type="scope.row.approveStatus | getType"
                            >
                                {{ scope.row.approveStatus | approveStatus }}
                            </el-tag>
                        </template>
                    </edu-table-column>
                    <edu-table-column
                        :label="$t('base.operate')"
                        prop="idCard"
                        min-width="170"
                        align="center"
                    >
                        <!-- 查看 -->
                        <template slot-scope="scope">
                            <el-button type="text" @click="toDetail(scope.row, 'view')">
                                {{ $t('base.view') }}
                            </el-button>
                        </template>
                    </edu-table-column>
                    <edu-table-column
                        :label="$t('InterAcaConfer.returnCounStatus')"
                        prop="reimbursementStatus"
                        min-width="120"
                        align="center"
                    >
                        <template slot-scope="scope">
                            <el-tag
                                v-if="scope.row.reimbursementStatus !== null"
                                :type="scope.row.reimbursementStatus | getType"
                            >
                                {{ scope.row.reimbursementStatus | reimbursementStatus }}
                            </el-tag>
                        </template>
                    </edu-table-column>
                    <edu-table-column
                        :label="$t('InterAcaConfer.returnCounOper')"
                        prop="idCard"
                        min-width="170"
                        align="center"
                    >
                        <template slot-scope="scope">
                            <!-- 查看 -->
                            <el-button
                                type="text"
                                v-show="scope.row.reimbursementStatus !== null"
                                @click="editCon(scope.row, 'view')"
                            >
                                {{ $t('base.view') }}
                            </el-button>
                        </template>
                    </edu-table-column>
                </edu-table>
                <el-row type="flex" class="row-bg" justify="end">
                    <el-col>
                        <el-pagination
                            @size-change="handleSizeChange"
                            @current-change="handleCurrentChange"
                            :current-page="queryForm.pageNum_"
                            :page-sizes="[20, 40, 80, 100]"
                            :page-size="queryForm.pageSize_"
                            layout="total, sizes, prev, pager, next, jumper"
                            :total="queryForm.total_"
                            style="float:right;margin-top:10px"
                        ></el-pagination>
                    </el-col>
                </el-row>
            </el-card>
        </div>
        <!-- 申请审核 查看页面 -->
        <div v-if="ifShowList === 2">
            <audit-Page-OfCon
                @returnVal="changekey"
                :studentInfo="studentInfo"
                :pgConferenceApply="pgConferenceApply"
                :pgExchangeHistory="pgExchangeHistory"
                :approveHistory="approveHistory"
                :file="file"
                :submitType="submitType"
                :countryList="countryList"
                :actNo="actNo"
                :pageFrom="pageFrom"
                :reimbursementId="reimbursementId"
            ></audit-Page-OfCon>
        </div>
        <!-- 报销页面 -->
        <div v-if="ifShowList === 3">
            <audit-Pro-Rep-And-Exp-Rei
                @returnVal="changekey"
                :tranParm="tranParm"
                :ifAudit="ifAudit"
                :pageFrom="pageFrom"
            ></audit-Pro-Rep-And-Exp-Rei>
        </div>
        <edu-export-dialog :title="$t('message.prompt')" ref="downloadRef"></edu-export-dialog>
    </div>
</template>
<script>
var _THIS
import auditPageOfCon from './auditPageOfCon'
import auditProRepAndExpRei from './auditProRepAndExpRei'
import { queryDic } from 'common/src/api/dictionary'
import revOfInterAcaConApi from 'common/src/api/internationalCommunication/revOfInterAcaCon'
import appListOfIntAcaConApi from 'common/src/api/internationalCommunication/appListOfIntAcaCon'
import UTILS from 'common/src/utils/utils'
import baseUrl from 'common/src/api/internationalCommunication/env'
export default {
    components: {
        'audit-Page-OfCon': auditPageOfCon,
        'audit-Pro-Rep-And-Exp-Rei': auditProRepAndExpRei
    },
    data() {
        return {
            queryForm: {
                pageNum_: 1,
                pageSize_: 20,
                total_: 0,
                condition: {
                    faculty: '',
                    profession: '',
                    studentId: '',
                    studentName: '',
                    conferenceLevel: '',
                    approveStatus: '',
                    reimbursementStatus: '',
                    conferenceCnOrEn: '',
                    conferenceStartTime: '',
                    conferenceEndTime: '',
                    approveStartTime: '',
                    approveEndTime: ''
                }
            },
            auditTimeRange: [],
            startDatePicker: this.beginDate(),
            endDatePicker: this.processDate(),
            dataList: [],
            pageFrom: '',
            tranParm: {
                conferenceStartTime: '',
                conferenceEndTime: '',
                id: '',
                studentId: '',
                submitType: '',
                reimbursementActNo: '',
                reimbursementId: ''
            },
            ifAudit: '',
            reimbursementId: '',
            actNo: '',
            countryList: {
                country: []
            },
            ifShowList: 1,
            studentInfo: {},
            pgConferenceApply: {},
            pgExchangeHistory: [],
            approveHistory: [],
            file: [],
            submitType: '',
            applyForm: {
                attachFile: [],
                attachName: []
            },
            multipleSelection: [],
            options: {
                conferenceLevel: [
                    // 顶级会议
                    { value: 1, label: this.$t('conOfIntAcaCon.topMeeting') },
                    // A类会议
                    { value: 2, label: this.$t('conOfIntAcaCon.AMeeting') },
                    // B类会议
                    { value: 3, label: this.$t('conOfIntAcaCon.BMeeting') }
                ],
                faculty: [],
                profession: [],
                approveStatus: [
                    // 已提交
                    {
                        label: this.$t('base.commit'),
                        value: 1
                    },
                    // 待审核
                    {
                        label: this.$t('base.toAudit'),
                        value: 2
                    },
                    // 通过
                    {
                        label: this.$t('base.pass'),
                        value: 3
                    },
                    // 不通过
                    {
                        label: this.$t('base.refuse'),
                        value: 5
                    }
                ],
                reimbursementStatus: [
                    // 已提交
                    {
                        label: this.$t('base.commit'),
                        value: 1
                    },
                    // 待审核
                    {
                        label: this.$t('base.toAudit'),
                        value: 2
                    },
                    // 通过
                    {
                        label: this.$t('base.pass'),
                        value: 3
                    }
                ]
            }
        }
    },
    created() {
        _THIS = this;
        // 初始化列表
        this.getListData()
        this.initOptions()
    },
    filters: {
        
        meeting(val) {
            switch (val) {
                case 1:
                    return _THIS.$t('conOfIntAcaCon.topMeeting')
                case 2:
                    return _THIS.$t('conOfIntAcaCon.AMeeting') 
                case 3:
                    return _THIS.$t('conOfIntAcaCon.BMeeting')
                default:
                    return ' '
            }
        },
        approveStatus(val) {
            switch (val) {
                case 1:
                    return _THIS.$t('base.commit')
                case 2:
                    return _THIS.$t('base.toAudit')
                case 3:
                    return _THIS.$t('base.pass')
                case 5:
                    return _THIS.$t('base.refuse')
                default:
                    return ' '
            }
        },
        getType(val) {
            switch (val) {
                case 0:
                    return 'info'
                case 1:
                    return 'info'
                case 2:
                    return 'info'
                case 3:
                    return 'success'
                case 4:
                    return 'warning'
                case 5:
                    return 'danger'
                default:
                    return val
            }
        },
        reimbursementStatus(val) {
            switch (val) {
                case 1:
                    return _THIS.$t('base.commit')
                case 2:
                    return _THIS.$t('base.toAudit')
                case 3:
                    return _THIS.$t('base.pass')
                default:
                    return ' '
            }
        }
    },
    methods: {
        async initOptions() {
            // 筛选条件字典查询
            let data = {
                lang: this.$store.getters.language || 'cn',
                type: 'allChild',
                keys: [
                    'X_YX' // 学院
                ]
            }
            await queryDic(data).then(res => {
                UTILS.fillSelect(
                    {
                        faculty: 'X_YX' // 学院
                    },
                    res.data,
                    this.options
                )
            })
        },

        // 修改学院
        changeCollege(val) {
            this.options.profession = []
            this.queryForm.condition.profession = ''
            let data = {
                lang: this.$store.getters.language || 'cn',
                type: 'allChild',
                keys: ['G_ZY'],
                filter: {
                    prefix: [val],
                    specilaCode: 'XY2ZY',
                    facultys: [val]
                }
            }
            queryDic(data).then(res => {
                UTILS.fillSelect(
                    {
                        profession: 'G_ZY' // 专业
                    },
                    res.data,
                    this.options
                )
            })
        },
        async getCountry() {
            // 筛选条件字典查询
            let data = {
                lang: this.$store.getters.language || 'cn',
                type: 'allChild',
                keys: [
                    'G_GJQU' // 国家/地区
                ]
            }
            await queryDic(data).then(res => {
                UTILS.fillSelect(
                    {
                        country: 'G_GJQU' // 国家/地区
                    },
                    res.data,
                    this.countryList
                )
            })
        },
        beginDate() {
            let _this = this
            return {
                disabledDate(time) {
                    if (_this.queryForm.condition.conferenceEndTime) {
                        //如果结束时间不为空，则小于结束时间
                        return (
                            new Date(_this.queryForm.condition.conferenceEndTime).getTime() <
                            time.getTime()
                        )
                    } else {
                        // return time.getTime() > Date.now()//开始时间不选时，结束时间最大值小于等于当天
                    }
                }
            }
        },
        processDate() {
            let _this = this
            return {
                disabledDate(time) {
                    if (_this.queryForm.condition.conferenceStartTime) {
                        //如果开始时间不为空，则结束时间大于开始时间
                        return (
                            new Date(_this.queryForm.condition.conferenceStartTime).getTime() >
                            time.getTime()
                        )
                    } else {
                        // return time.getTime() > Date.now()//开始时间不选时，结束时间最大值小于等于当天
                    }
                }
            }
        },

        // 获取申请信息
        async getDetail(id) {
            let _this = this
            await _this.getCountry()
            appListOfIntAcaConApi.getConferenceDetails(id).then(res => {
                if (res.data.studentInfo) {
                    _this.studentInfo = res.data.studentInfo
                }
                if (res.data.pgConferenceApply) {
                    _this.pgConferenceApply = res.data.pgConferenceApply
                }
                if (res.data.pgExchangeHistory) {
                    _this.pgExchangeHistory = res.data.pgExchangeHistory
                }
                if (res.data.approveHistory) {
                    _this.approveHistory = res.data.approveHistory
                }
                if (res.data.file) {
                    _this.file = res.data.file
                }
            })
        },
        // 跳转申请查看 审核页
        toDetail(row, val) {
            this.getDetail(row.id)
            this.reimbursementId = row.reimbursementId
            this.actNo = row.actNo
            this.ifShowList = 2
            this.submitType = val
            this.pageFrom = 'confer'
        },
        // 跳转报销查看 审核页
        editCon(row, val) {
            this.ifShowList = 3
            this.ifAudit = val
            this.pageFrom = 'confer'
            this.setParm(row)
        },

        // 报销传参
        setParm(row) {
            this.tranParm.conferenceEndTime = row.conferenceEndTime
            this.tranParm.conferenceStartTime = row.conferenceStartTime
            this.tranParm.id = row.id
            this.tranParm.studentId = row.studentId
            this.tranParm.reimbursementId = row.reimbursementId
            this.tranParm.reimbursementActNo = row.reimbursementActNo
            this.tranParm.submitType = 'view'
        },
        // 审核-查看页返回
        changekey(val) {
            this.ifShowList = val
            this.getListData()
        },
        handleSizeChange(val) {
            this.queryForm.pageSize_ = val
            this.getListData()
        },
        handleCurrentChange(val) {
            this.queryForm.pageNum_ = val
            this.getListData()
        },
        handleSelectionChange(val) {
            this.multipleSelection = val
        },
        reset() {
            this.queryForm = {
                pageNum_: 1,
                pageSize_: 20,
                total_: 0,
                condition: {
                    faculty: '',
                    profession: '',
                    studentId: '',
                    studentName: '',
                    conferenceLevel: '',
                    approveStatus: '',
                    reimbursementStatus: '',
                    conferenceCnOrEn: '',
                    conferenceStartTime: '',
                    conferenceEndTime: '',
                    approveStartTime: '',
                    approveEndTime: ''
                }
            }
            this.auditTimeRange = []
            this.options.profession = []
            this.getListData()
        },
        onSubmit() {
            this.queryForm.pageNum_ = 1
            this.queryForm.total_ = 0
            this.queryForm.pageSize_ = 20

            this.getListData()
        },
        // 获取列表页
        getListData() {
            let _this = this
            this.dataList = []
            if (this.auditTimeRange) {
                this.queryForm.condition.approveStartTime = this.auditTimeRange[0]
                this.queryForm.condition.approveEndTime = this.auditTimeRange[1]
            } else {
                this.queryForm.condition.approveEndTime = ''
                this.queryForm.condition.approveStartTime = ''
            }

            revOfInterAcaConApi.getApproveListBySchool(this.queryForm).then(res => {
                res.data.list.forEach(revList => {
                    _this.dataList.push(revList)
                    _this.queryForm.pageSize_ = res.data.pageSize_
                    _this.queryForm.total_ = res.data.total_
                    _this.queryForm.pageNum_ = res.data.pageNum_
                })
            })
            this.multipleSelection = []
        },
        // 导出
        exportConference(exportType) {
            let _this = this
            let parm = {
                faculty: this.queryForm.condition.faculty,
                profession: this.queryForm.condition.profession,
                studentId: this.queryForm.condition.studentId,
                studentName: this.queryForm.condition.studentName,
                conferenceLevel: this.queryForm.condition.conferenceLevel,
                approveStatus: this.queryForm.condition.approveStatus,
                reimbursementStatus: this.queryForm.condition.reimbursementStatus,
                conferenceCnOrEn: this.queryForm.condition.conferenceCnOrEn,
                conferenceStartTime: this.queryForm.condition.conferenceStartTime,
                conferenceEndTime: this.queryForm.condition.conferenceEndTime,
                approveStartTime: this.queryForm.condition.approveStartTime,
                approveEndTime: this.queryForm.condition.approveEndTime,
                roleType: '2',
                ids: []
            }
            if (_this.multipleSelection) {
                _this.multipleSelection.forEach(val => {
                    parm.ids.push(val.id)
                })
            }
            let flag = false
            if (this.multipleSelection.length > 0) {
                this.multipleSelection.forEach(sel => {
                    if (sel.reimbursementStatus !== null) {
                        flag = true
                    }
                })
            } else {
                flag = true
            }
            if (_this.dataList.length === 0) {
                // 无数据
                _this.$message.error(this.$t('base.noData'))
            } else if (flag === false && exportType === 'rev') {
                _this.$message.error(this.$t('base.noData'))
            } else {
                this.$refs.downloadRef.open()
                if (exportType === 'export') {
                    revOfInterAcaConApi
                        .exportConference(parm)
                        .then(res => {
                            if (res.code === 200) {
                                revOfInterAcaConApi.exportConferenceT(res.data.key).then(resT => {
                                    if (res.code === 200 && resT && resT.data && resT.data.path) {
                                        revOfInterAcaConApi
                                            .exportExcelT(resT.data.path)
                                            .then(resS => {
                                                // 导出成功
                                                _this.$message({
                                                    message: this.$t('base.exportSuccess'),
                                                    type: 'success'
                                                })
                                                this.$refs.downloadRef.close()
                                            })
                                    } else {
                                        _this.exportNext(res.data.key, exportType)
                                    }
                                })
                            }
                        })
                        .catch(err => {
                            this.$refs.downloadRef.close()
                        })
                } else if (exportType === 'advance') {
                    revOfInterAcaConApi
                        .advanceExport(parm)
                        .then(res => {
                            if (res.code === 200) {
                                revOfInterAcaConApi.exportConferenceT(res.data.key).then(resT => {
                                    if (res.code === 200 && resT && resT.data && resT.data.path) {
                                        revOfInterAcaConApi
                                            .exportExcelT(resT.data.path)
                                            .then(resS => {
                                                // 高级导出 成功
                                                _this.$message({
                                                    message: this.$t('base.exportAdvSuccess'),
                                                    type: 'success'
                                                })
                                                this.$refs.downloadRef.close()
                                            })
                                    } else {
                                        _this.exportNext(res.data.key, exportType)
                                    }
                                })
                            }
                        })
                        .catch(err => {
                            this.$refs.downloadRef.close()
                        })
                } else if (exportType === 'rev') {
                    if (flag) {
                        _this.exportNext(parm, exportType)
                    }
                }
            }
        },
        // 导出接口轮询
        exportNext(val, exportType) {
            let _this = this
            setTimeout(() => {
                if (exportType === 'rev') {
                    revOfInterAcaConApi.downExcel(val).then(resM => {
                        if (resM.code === 200 && resM.data) {
                            let path = `${baseUrl}/pgIntlConference/downloadFile?path=` + resM.data
                            window.open(path)
                            // 回国报销导出成功
                            _this.$message({
                                message: this.$t('InterAcaConfer.exportRev'),
                                type: 'success'
                            })
                            this.$refs.downloadRef.close()
                        } else {
                            _this.exportNext(val, exportType)
                        }
                    })
                } else {
                    revOfInterAcaConApi.exportConferenceT(val).then(resT => {
                        if (resT.data.path) {
                            revOfInterAcaConApi.exportExcelT(resT.data.path).then(resS => {
                                if (exportType === 'advance') {
                                    // 高级导出成功
                                    _this.$message({
                                        message: this.$t('base.exportAdvSuccess'),
                                        type: 'success'
                                    })
                                } else if (exportType === 'export') {
                                    // 导出成功
                                    _this.$message({
                                        message: this.$t('base.exportSuccess'),
                                        type: 'success'
                                    })
                                }

                                this.$refs.downloadRef.close()
                            })
                        } else {
                            _this.exportNext(val, exportType)
                        }
                    })
                }
            }, 3000)
        }
    },
    watch: {}
}
</script>
<style lang="scss" scoped>
.condition-card ::v-deep {
    .el-row {
        height: 30px !important;
    }
    .el-form-item {
        margin-bottom: 0 !important;
    }
}
.roster-container ::v-deep {
    .el-date-editor--datetimerange.el-input__inner {
        width: 100% !important;
    }
    .el-form {
        padding-right: 15px;
    }
}
.condition-title {
    color: #2b3b4e;
    font-size: 18px;
    line-height: 24px;
    font-weight: bold;
}
.sub-title {
    margin: 16px 0 65px 0;
    font-size: 16px;
    color: #000020;
    letter-spacing: 0;
}
</style>
